package iostream;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class InOdemo2 {
    //读取 文件
    public static void main(String[] args) throws IOException {
        //准备源文件对象
        File file = new File("D:\\develop\\idea\\javase-code\\day09-code\\src\\file\\new 1.txt");
        FileInputStream fis = new FileInputStream(file);
        System.out.println("文件大小：" + file.length());

        while (fis.read() > 0){
            System.out.print((char)fis.read());
        }
        fis.close();
        System.out.println("文件读取完毕");
    }
}
